package ay.shadow.stock.controller;

import ay.shadow.core.body.R;
import ay.shadow.stock.entity.query.SeckillQuery;
import ay.shadow.stock.service.openService.ShadowOrderService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("stock")
@RestController
@RequiredArgsConstructor
public class StockController {
    private final ShadowOrderService shadowOrderService;


    @PostMapping("seckill")
    public R getDeskillOrders(SeckillQuery seckillQuery) {
        shadowOrderService.createOrder(seckillQuery);
        return R.ok();
    }

    @GetMapping("getStock")
    public R getStock() {
        return R.ok("Hello World");
    }
}
